<template>
        <div class="zxyA">
          <div>
            <el-card>
            <div style="font-size: 24px; color: #000000">账号信息</div>
          <el-divider></el-divider>
          <el-form ref="form" :model="form" label-width="80px">
        <el-form-item label="用户名">
          <span>{{ $store.getters.userName}}</span>
        </el-form-item>
        <el-form-item label="绑定邮箱">
          <span>{{ $store.getters.userEmail}}</span>
        </el-form-item>  
        <el-form-item label="审核进度">
          <el-link :underline="false" v-if="examineType=='学术成果审核'" @click="displayAch()">学术成果审核</el-link>
          <el-link :underline="false" v-if="examineType=='门户认领审核'">门户认领审核</el-link>
          <span v-if="examineType=='NoData'">尚无正在审核的内容！</span>
        </el-form-item>       
      </el-form>
      <el-button plain @click="goToModify()" :icon="this.Edit">修改信息</el-button> 
          </el-card>
          </div>
          <div style="padding-top:20px;">
            <el-card v-if="achievementDisplay">
            <div style="font-size: 24px; color: #000000">学术成果审核进度</div>
            <el-divider></el-divider>
            <el-table :data="achievementContext" stripe style="width: 100%" :cell-style="cellStyle">
                    <el-table-column label="id" prop="id"  width="180" />
                    <el-table-column label="标题" prop="title"  width="180" />
                    <el-table-column label="是否通过" prop="is_passed" width="180" />
                    <el-table-column label="管理员意见" prop="message_from_admin" width="180" />
            </el-table>
            </el-card>
          </div>
          <div style="padding-top:20px;">
            <el-card v-if="doorDisplay">
            <div style="font-size: 24px; color: #000000">门户认领审核进度</div>
            <el-divider></el-divider>
            <el-table :data="doorContext" stripe style="width: 100%" :cell-style="cellStyle">
                    <el-table-column label="id" prop="id"  width="180" />
                    <el-table-column label="门户ID" prop="portal_id"  width="180" />
                    <el-table-column label="验证信息" prop="authentication"  width="180" />
                    <el-table-column label="是否通过" prop="is_passed" width="180" />
                    <el-table-column label="管理员意见" prop="message_from_admin" width="180" />
            </el-table>
            </el-card>
          </div>
        </div>
        
</template>

<script>
import { defineComponent, reactive, toRefs } from "vue";
import {Edit} from "@element-plus/icons";
import logo from "../assets/no_border.png";
import axios from "axios";
import qs from 'qs';
export default defineComponent({
  setup() {
    const state = reactive({
      logo,
      Edit,
      examineType:'',
      achievementContext:[],
      achievementDisplay:false,
      doorContext:[],
      doorDisplay:false
    });
    return {
      ...toRefs(state),
    };
  },
  methods: {
    goToModify(){
      this.$router.push("/personalcenterformodify");
    },
    displayAch(){
      this.achievementDisplay=true
    }
  },
  created(){
    let dataA={
            uid:this.$store.getters.userID,
        }
    let data=qs.stringify(dataA)
    axios.post("user_get_audit_info/",data).then((res) => {
          console.log(res.data);
          if(res.data.code==0){
            this.examineType=res.data.audit_info.type
            if(this.examineType=='学术成果审核'){
              this.achievementContext=res.data.audit_info.context
            }
            if(this.examineType=='门户认领审核')
              this.doorContext=res.data.audit_info.context
          }
      });
  },
});
</script>


<style scoped>
.zxyA {
  margin-top: 30px;
  width: 800px;
  position: absolute;
  left: calc(50% - 400px);
  text-align: left;
}

</style>